#!/bin/bash
x_pass(){
  pass=$(grep password /var/log/mysqld.log|awk  '{print $NF}')
  new_pass=Aa123456.
  mysql -uroot -p"$pass" --connect-expired-password <<EOF
alter user root@'localhost' identified by '$new_pass';
flush privileges;
create user root@'%' identified by '$new_pass';
grant all privileges on *.* to root@'%';
flush privileges;
EOF
}
x_pass
mysql -uroot -p$new_pass < /opt/ry-zzyl_20240913.sql
sed -i 's/^bind.*$/bind * -::*/' /etc/redis/redis.conf
echo 'requirepass 123456' >> /etc/redis/redis.conf
sed -i 's/^pool.*$/pool 192.168.88.130 iburst/g' /etc/chrony.conf
